//获取频道列表的逻辑
import { useState,useEffect } from "react"
import { getChannelAPI }from '@/apis/article'


function useChannel(){
    const [channelList, setChannels] = useState([])

    // 调用接口
    useEffect(() => {
      const getChannelList = async () => {
        const res = await getChannelAPI()
        setChannels(res.data.channels)
  
      }
      getChannelList()
  
    }, [])
    return {channelList}
}

export {useChannel}